﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using yiCommerce.Service.Shops;

namespace yiCommerce.Areas.Admin.Controllers.api
{
    public class ShopApiController : ApiController
    {



        private IShopService _shopService;

        public ShopApiController(IShopService shopService)
        {
            _shopService = shopService;
        }

        public AssignShopOwnerResult AssignShopOwner(AssignShopOwnerRequest request)
        {
            var result = new AssignShopOwnerResult();
            try
            {

                _shopService.AssignShopOwner(request.ShopId, request.OwnerId);
                result.Status = "0";
            }
            catch (Exception e)
            {
                
                result.Status = "1";
                result.Message = e.Message;
            }


            return result;
        }

    }

    public class AssignShopOwnerRequest
    {
        public int ShopId { get; set; }
        public int OwnerId { get; set; }
    }

    public class  AssignShopOwnerResult
    {
        public string Status { get; set; }
        public string Message { get; set; }
    }
}
